using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Wpf_Scrcpy.MOD
{
    /// <summary>
    /// 设备显示信息结构体
    /// </summary>
    public struct DeviceDisplayInfo
    {
        /// <summary>
        /// 屏幕宽度
        /// </summary>
        public int Width { get; set; }

        /// <summary>
        /// 屏幕高度
        /// </summary>
        public int Height { get; set; }

        /// <summary>
        /// 屏幕密度DPI
        /// </summary>
        public int Density { get; set; }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="width">宽度</param>
        /// <param name="height">高度</param>
        /// <param name="density">密度</param>
        public DeviceDisplayInfo(int width, int height, int density)
        {
            Width = width;
            Height = height;
            Density = density;
        }

        /// <summary>
        /// 是否为有效的显示信息
        /// </summary>
        public bool IsValid
        {
            get { return Width > 0 && Height > 0; }
        }

        public override string ToString()
        {
            return $"{Width}x{Height} ({Density} DPI)";
        }
    }
}
